const { screenWidth, screenHeight, devicePixelRatio, platform} = wx.getSystemInfoSync()

export const innerWidth = screenWidth
export const innerHeight = screenHeight
export { devicePixelRatio }
export const screen = {
  availWidth: innerWidth,
  availHeight: innerHeight
}


let WX_GAME_ENV = typeof wx !== 'undefined';
let WX_GAME_DEVTOOLS = false;

if (WX_GAME_ENV) {
  if (platform == "devtools") {
    WX_GAME_DEVTOOLS = true;
  }
}

export const performance = {

  now() {
    if (WX_GAME_ENV) {
      if (WX_GAME_DEVTOOLS)
        return wx.getPerformance().now();
      else
        return wx.getPerformance().now() / 1000;
    } else {
      return performance.now();
    }
  }
}

// export const performance = wx.getPerformance()
export const ontouchstart = null
export const ontouchmove = null
export const ontouchend = null
